<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>固定背景</title>
    <style>
         body{
             padding: 0;
             margin: 0;
             background-image: url(../imgs/img1.png);
             background-repeat: no-repeat;
             background-attachment: fixed;
             background-position: top center;
         }
		 .content{
			 height: 1000px;
		 }
		 
		 .box1{
			 padding: 0;
			 margin: 0;
			 background-image: url(../imgs/img2.jpg);
			 background-attachment: scroll;
			 background-position: center;
			 background-repeat: no-repeat;
			 height: 100px;
		 }
		 .box2{
			 height: 100px;
			 background-color: red;
			 background-attachment: local;
			 background-image: url(../imgs/img3.jpg);
		 }
		 
		 .box2>div[class^="box3"]{
			 height: 50px;
		 }
    </style>
</head>
<body>
     <div class="content">
		 <div class="box1"></div>
		 <div class="box2">
			 <div class="box3-1"></div>
			 <div class="box3-2"></div>
			 <div class="box3-3"></div>
			 <div class="box3-4"></div>
			 <div class="box3-5"></div>
		 </div>
	 </div>
</body>
</html>